#include <iostream>
#define N 100

using namespace std;

void read_matrix(int matrix[N][N], int row, int column){
int i, j;
for (i=0;i<row;i++)
    for(j=0;j<column;j++){
        cout<<"["<<i<<"]["<<j<<"]= ";
        cin>>matrix[i][j];}
}

void print_matrix(int matrix[N][N], int row, int column){
int i,j;
for (i=0;i<row;i++){
    for(j=0; j<column; j++)
			cout<<matrix[i][j]<<" ";
		cout<<endl;}
}

int main(){
int row;
int column;
int matrix[N][N];
int i,j;
int row1, row2, column1, column2, aux;

cout<<"Type the number of rows: " ;
cin>>row;
cout<<"Type the number of columns: " ;
cin>>column;

read_matrix(matrix, row, column);

cout<<"Row 1 to swap: ";
cin>>row1;
cout<<"Row 2 to swap: ";
cin>>row2;
cout<<"Column 1 to swap: ";
cin>>column1;
cout<<"Column 2 to swap: ";
cin>>column2;

for(j=0;j<column;j++){
    aux=matrix[row1][j];
    matrix[row1][j]=matrix[row2][j];
    matrix[row2][j]=aux;}
for(i=0;i<row;i++){
    aux=matrix[i][column1];
    matrix[i][column1]=matrix[i][column2];
    matrix[i][column2]=aux;}

print_matrix(matrix, row,column);


return 0;
}
